package dockyin.structure.pattern.proxy;

public class Proxy implements Sourceable {
    private Sourceable source;

    public Proxy() {
        super();
        source = new Source();
    }

    @Override
    public void method() {
        onBefore();
        source.method();
        onAfter();
    }

    private void onBefore() {
        System.out.println("Before action in proxy.");
    }

    private void onAfter() {
        System.out.println("After action in proxy.");
    }
}
